package com.usian.user.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.usian.apis.user.ApUserFollowControllerApi;
import com.usian.model.user.dtos.FindUaFDto;
import com.usian.model.user.pojos.ApUserFollow;
import com.usian.user.service.apUserFollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user_follow")
public class ApUserFollowController implements ApUserFollowControllerApi {
   @Autowired
   apUserFollowService apUserFollowService;

    @PostMapping("/one")
    @Override
    public ApUserFollow findByUserIdAndFollowId(@RequestBody FindUaFDto dto) {
        return apUserFollowService.getOne(Wrappers.<ApUserFollow>lambdaQuery()
                .eq(ApUserFollow::getUserId,dto.getUserId())
                .eq(ApUserFollow::getFollowId,dto.getFollowId()));
    }
}
